<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="socialnexus.admin.Users.Edit"
    MasterPageFile="~/masters/Admin.Master" %>

<asp:Content ContentPlaceHolderID="body" runat="server">

<h1>Edit User Data</h1>

<div><asp:HiddenField runat="server" ID="hfUserId" /></div>

<fieldset>
<legend>Personal Info</legend>

    <div class="formLineItem">
        Username: <br />
        <asp:Label ID="txtUsername" Font-Bold="true" runat="server" />
    </div>

    <div class="formLineItem">
        <asp:Label ID="lblFirstName" runat="server" Text="First Name" 
            AssociatedControlID="txtFirstName" />
        <asp:TextBox ID="txtFirstName" runat="server" />
        <asp:RequiredFieldValidator ControlToValidate="txtFirstName" runat="server"
            ErrorMessage="First Name is required." Display="Dynamic" ValidationGroup="UserData" />
    </div>

    <div class="formLineItem">
        <asp:Label ID="lblLastName" runat="server" Text="Last Name"
            AssociatedControlID="txtLastName" />
        <asp:TextBox ID="txtLastName" runat="server" />
        <asp:RequiredFieldValidator ControlToValidate="txtFirstName" runat="server"
            ErrorMessage="Last Name is required." Display="Dynamic"  ValidationGroup="UserData" />
    </div>

    <div class="formLineItem">
    <asp:ScriptManager ID="smMain" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">      
      <ContentTemplate>
        <asp:Label AssociatedControlID="rblPictureType" runat="server" Text="Picture" />
        <asp:RadioButtonList runat="server" AutoPostBack="true" ID="rblPictureType"
            OnSelectedIndexChanged="rblPictureType_SelectedIndexChanged" RepeatDirection="Horizontal">
            <asp:ListItem Value="File" Text="File" />
            <asp:ListItem Value="URL" Text="URL" />
        </asp:RadioButtonList>

        <asp:Panel ID="tab1Content" runat="server" Visible="true" CssClass="formLineItem">
            <asp:Label AssociatedControlID="fuPicture" Text="File Upload" runat="server" />
            <asp:FileUpload ID="fuPicture" runat="server" />
        </asp:Panel>

        <asp:Panel ID="tab2Content" runat="server" Visible="false" CssClass="formLineItem">
            <asp:Label AssociatedControlID="txtPictureURL" Text="Picture URL" runat="server" />
            <asp:TextBox ID="txtPictureURL" runat="server" Width="300" />
        </asp:Panel>
      </ContentTemplate>
    </asp:UpdatePanel>
    </div>

    <p>
        <asp:Button runat="server" Text="Save Changes" ID="btnSave" OnClick="btnSave_Click" />
        <asp:HyperLink runat="server" NavigateUrl="~/admin/Users/Default.aspx" Text="Cancel" />
    </p>
</fieldset>

<fieldset>
<legend>Change Password</legend>

<asp:Label ID="lblPasswordError" runat="server" CssClass="error" Visible="false" EnableViewState="false" />

<div class="formLineItem">
    <asp:Label ID="lblPassword" runat="server" Text="Password"
        AssociatedControlID="txtPassword" />
    <asp:TextBox ID="txtPassword" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtPassword" runat="server"
        ErrorMessage="The password is required." Display="Dynamic" ValidationGroup="Password" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblPasswordConfirm" runat="server" Text="Password Confirmation"
        AssociatedControlID="txtPasswordConfirm" />
    <asp:TextBox ID="txtPasswordConfirm" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="txtPasswordConfirm" runat="server"
        ErrorMessage="The password confirmation is required." Display="Dynamic" ValidationGroup="Password" />
    <asp:CustomValidator ID="CustomValidator2" ControlToValidate="txtPasswordConfirm" runat="server"
        OnServerValidate="ValidatePassword" Text="Passwords do not match." Display="Dynamic"
        ValidationGroup="Password" />
</div>
<asp:Button runat="server" Text="Change Password" ID="btnPasswordChange" 
    OnClick="btnPasswordChange_Click" />
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/admin/Users/Default.aspx" Text="Cancel" />
</fieldset>


</asp:Content>